<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 先引入核心库 -->
    <script src="./js/react.development.js"></script>
    <!-- 再引入拓展库 用于react支持dom操作 -->
    <script src="./js/react-dom.development.js"></script>
    <!-- 引入jsx转js库 -->
    <script src="./js/babel.min.js"></script>
</head>

<body>
    <div id="test"></div>
    <!-- //此处一定要写babel -->
    <script type="text/babel">
        class Mything extends React.Component {
            constructor(props){
                super(props)
                this.state = {isHot:false}
            }
            render(){
                return <h2>今天的天气是{this.state.isHot ? '炎热': '凉爽'}的</h2>
            }
        }
        ReactDOM.render(<Mything/>, document.querySelector('#test'))
    </script>
</body>

</html>